﻿using UnityEngine;
using System.Collections;

public class SQMenuBase : MenuBase
{
    public override void unpopMe()
    {
        this.StartSparkCoroutine(FadeOutUnpop);
    }

    protected IEnumerator FadeOutUnpop()
    {
        Animator animator = GetComponent<Animator>();
        if (animator != null)
        {
            animator.Play("FadeOut");
            yield return null;
            yield return new WaitForAnimation(GetComponent<Animator>());
        }
        base.unpopMe();
    }

    //public void popCommonMenu(string text)
    //{
    //    CommonMenuLogic commonMenu = UIManager.Instance.popMenu<CommonMenuLogic>("CommonMenu");
    //    commonMenu.setText(text);
    //}

    //public void popFunctionNotAvaliableMenu()
    //{
    //    popCommonMenu("功能尚未开放");
    //}
}
